<template>
	<view class="competitive-summary" @click="navTo" :style="istyle">
		<view class="subject">{{ item.subject_name }}</view>
		<view class="summary-wrap">
			<view class="summary">
				<text class="title">{{ item.course_title }}</text>
				<text class="date" v-if="!iend">进行到 {{ item.schedule }} | 下次上课 &nbsp; {{ item.teach_day }} &nbsp; {{ item.teach_time }}</text>
				<text class="date" v-else>进行到 {{ item.schedule }} | 课程已结束</text>
			</view>
			<view class="discount">
				<!-- <view class="discount-tip">00:30:05</view> -->
				<view class="discount-tip">&nbsp;</view>
				<view class="discount-tip ended-lesson" v-if="iend">已结课</view>
				<view class="discount-tip" v-else>开始上课</view>
			</view>
		</view>
		<view class="teacher-wrap">
			<view class="teacher" v-for="(src, index2) in item.figureimgsList" :key="index2">
				<view class="avatar">
					<image class="pic" :src="src"></image>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data () {
			return {
			}
		},
		props: {
			item: Object,
			istyle: String,
			iend: Boolean	// 是否已经结课
		},
		methods:{
			navTo(){
				uni.navigateTo({
					url: 'course-detail?course_id=' + this.item.course_id
				})
			}
		},
	}
</script>

<style scoped>
	.competitive-summary{position:relative; display:flex; flex-direction: column; width:100%; padding:40upx 30upx 30upx; background:#FFF; box-sizing: border-box; border-radius: 20upx;margin-bottom: 20upx;}
	
	.subject{position: absolute; z-index:99; left:30upx; top:0;  width:58upx; height:32upx; background:#fe9900; border-radius: 0 0 10upx 10upx; font-size:24upx; text-align: center; line-height:32upx; color:#fff;}

	.summary-wrap{display:flex; margin-top: -12upx; margin-bottom: 10upx;}
	.summary{display:flex; flex-direction: column;}
	.summary .title{font-size:34upx; font-weight:bold; color:#333;}
	.summary .date{font-size:24upx; color:#999;}
	
	.discount{display:flex; flex-direction: column;margin-top: 12upx;}
	.discount .discount-tip {font-size:24upx;font-family:Source Han Sans CN;font-weight:400;line-height:40upx;color: #666;}
	.discount .ended-lesson {color: #ccc;}
	
	.summary-wrap .discount{flex:1; text-align: right;min-width: 100upx;}
	
	.teacher-wrap{display:flex; margin-top:10upx;}
	.teacher{display:flex; margin-right:40upx;}
	.teacher .avatar{border-radius: 50%; width:60upx; height:60upx; overflow: hidden;}
	.teacher .avatar .pic{width:100%; height:100%; background:rgba(130,255,221,0.7);}
	.teacher .name{margin-left:20upx; margin-top:6upx; color:#666;}
	
	.teacher-wrap .statistic{flex:1; text-align: right; color:#666;}
	.teacher-wrap .statistic view{ font-size:20upx; font-family:Source Han Sans CN; font-weight:400; line-height:34upx; color:#666;}
	
</style>
